<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<style>
	div[name='searchColums']{
		height: 70px!important;
	}
</style>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
	<t:datagrid name="list" checkbox="true" fitColumns="false" title="" actionUrl="adminTimeTableController.do?datagrid" idField="id" fit="true" queryMode="group">
  	   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="周次"  field="weekNumber" queryMode="group" query="true" replace="${weekList }" width="200"></t:dgCol>
	   <t:dgCol title="日期"  field="courseDate" formatter="yyyy-MM-dd"  queryMode="single" width="80"> </t:dgCol>
	   <t:dgCol title="星期"  field="weekDayName" hidden="false" query="false"  queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="时间"  field="courseDate" formatter="yyyy-MM-dd HH:mm" hidden="false" query="false"  queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="节次"  field="courseOrder" query="false"  queryMode="group"  width="80"></t:dgCol>
<%-- 	   <t:dgCol title="学院"  field="lessonInfo.college.collegeName" query="true" replace="${colleges }"  queryMode="single" width="80"></t:dgCol> --%>
	   <t:dgCol title="班级"  field="grade.className" query="true" replace="${grades }" queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="人数"  field="peopleCount"  queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="课程名称"  field="lessonInfo.lessonName" query="true"   queryMode="single" replace="${lessonNames }" width="80"></t:dgCol>
	   <t:dgCol title="实验项目"  field="teachItem.itemName"   queryMode="single" query="false" width="80"></t:dgCol>
	   <t:dgCol title="任课教师"  field="teacher.realName"  query="false" queryMode="single"  width="80"></t:dgCol>
	   <t:dgCol title="带教老师"  field="coacher" query="false"  queryMode="single" width="80"></t:dgCol>
	   <t:dgCol title="实验室"  field="lab.labName"   queryMode="single" query="false" replace="${labNames }" width="80"></t:dgCol>
	   <t:dgCol title="实验室"  field="lab.id" hidden="true" queryMode="single" query="true" replace="${labNames }" width="80"></t:dgCol>
	   <t:dgCol title="学期" hidden="true" field="semesterInfo.semesterName" queryMode="single" query="true" replace="${semesterName }" width="80"></t:dgCol>
	   <t:dgCol title="操作" field="opt" width="80"></t:dgCol>
	   <t:dgFunOpt funname="editRow(id)" title="调整"></t:dgFunOpt>
	   <t:dgToolBar title="指派带教老师"  icon="icon-search" onclick="changeCoacher()"></t:dgToolBar>
	   <t:dgToolBar title="批量删除"  icon="icon-remove" url="adminTimeTableController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
	   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   </t:datagrid>
 </div>
 </div>           
 <script>
	//导出
	function ExportXls() {
		JeecgExcelExport("adminTimeTableController.do?exportXls","list");
	}
	
	function editRow(id){
		var url = 'teachCourseFastArrangeController.do?goCourseScheduleUpdate&id='+id;
		 $.dialog({
		  	id:'preview',
			content: 'url:' + url,
			lock : true,
			zIndex: 62, 
			width:500,
			height:280,
			title:'编辑', 
			opacity : 0.3,
			cache:false,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
	    		$('#btn_sub', iframe.document).click();  
		    	return false;	
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/,
		});	
	}
	
	//指派带教老师
	function changeCoacher(id){
		var rows = $('#list').datagrid('getSelections'); 
		if(rows.length!=1){
			tip('请选择1条数据');
			return;
		}
		var url = 'adminTimeTableController.do?goCoacherUpdate&id='+rows[0].id;
		 $.dialog({
		  	id:'selectCoacher',
			content: 'url:' + url,
			lock : true,
			zIndex: 62, 
			width:450,
			height:100,
			title:'编辑', 
			opacity : 0.3,
			cache:false,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
	    		$('#btn_sub', iframe.document).click();  
		    	return false;	
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/,
		});	
	}
	
 </script>       